import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-12-05
 * Time: 17:26
 */

//组队竞赛
//https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b?orderByHotValue=1&page=1&onlyReference=false
public class TeamCompetition {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
       while (scanner.hasNext()){
           int n = scanner.nextInt();
           long[] arr = new long[3*n];

           for (int i = 0; i < arr.length; i++) {
               arr[i] = scanner.nextLong();
           }
           //先排序 在分组
           Arrays.sort(arr);
           long sum = 0;
           for (int j = 0; j < n; j++) {
               sum += arr[arr.length-(2*(j+1))];
           }
           System.out.println(sum);
       }

    }
}
